﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectJobAssigneeList.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.ProjectJobAssigneeList" %>

<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ผู้รับผิดชอบ</title>
    <script src="../../Scripts/DatePicker.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-latest.js" type="text/javascript"></script>
    <link href="../../Styles/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server" style="font-size:small">
    <div>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

       <asp:LinkButton ID="AddNew" runat="server" CssClass="LinkButton" 
            CausesValidation="false" onclick="AddNew_Click"><img alt="" src="../Image/Grid/AddRecord.gif" />&nbsp;&nbsp;เพิ่มบุคลากรในงาน</asp:LinkButton>

        <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="dtEmployeeList" runat="server"
            AllowFilteringByColumn="true" AllowMultiRowSelection="true" 
            AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false" 
            PageSize="10" onneeddatasource="dtEmployeeList_NeedDataSource" OnItemCommand="dgtEmployeeList_Itemcommand" >

           <MasterTableView AllowMultiColumnSorting="true" DataKeyNames="bgm_proj_job_assignee_seq" ClientDataKeyNames="bgm_proj_job_assignee_seq" Width="100%">
            <Columns>
                <Telerik:GridBoundColumn HeaderText="PK"  UniqueName="bgm_proj_job_assignee_seq" DataField="bgm_proj_job_assignee_seq" Visible="false"></telerik:GridBoundColumn>
                <Telerik:GridBoundColumn UniqueName="emp_seq" DataField="emp_seq" Visible="false"></telerik:GridBoundColumn>
                <telerik:GridButtonColumn HeaderText="แก้ไข" ImageUrl="../Image/Grid/Edit.gif" ButtonType="ImageButton" CommandName="GridEdit">
                    <HeaderStyle Width="40px" />
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn HeaderText="ลบ" AllowFiltering="false">
                    <HeaderStyle Width="40px" />
                    <ItemTemplate>
                        <asp:ImageButton ImageUrl="../Image/Grid/Delete.gif" ID ="imgDelete" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" CommandName="GridDelete" runat="server"/>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn HeaderText="ชื่อ" DataField="emp_name" UniqueName="emp_name"
                    ShowFilterIcon="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%">
                    <HeaderStyle Width="100px" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="ตำแหน่ง" DataField="pos_name" UniqueName="pos_name"
                    ShowFilterIcon="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%">
                    <HeaderStyle Width="100px" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="สังกัด" DataField="job_site_name" UniqueName="job_site_name"
                    ShowFilterIcon="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn HeaderText="หมายเหตุ" DataField="job_remark" UniqueName="job_remark"
                    ShowFilterIcon="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" FilterControlWidth="100%">
                    <HeaderStyle Width="100px" />
                </telerik:GridBoundColumn>
            </Columns>
         </MasterTableView>
         </telerik:RadGrid>

         <div>
            <asp:Label ID="lblTest" runat="server" />
             <asp:Panel ID="pnlInfo" runat="server">
             <div class="header-grid">
             <asp:Label ID="lblModeName" runat="server" />
             </div>
                <table>
                    <tr>
                        <td>บุคลากร:</td>
                        <td>
                            <asp:Label ID="lblProjJobAssign" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblJobSite" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblProjJobAssignee" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblEmpSeq" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lblPosName" runat="server" Visible="false"></asp:Label>
                            <telerik:RadComboBox ID="ddlEmployeeList" runat="server" Width="300px" 
                                DataValueField="emp_seq"
                                DataTextField="emp_name" EmptyMessage="---กรุณาเลือกผู้รับผิดชอบ---"
                                Filter="Contains"
                                HighlightTemplatedItems="true">

                                <HeaderTemplate>
                                     <table style="width: 100%" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td width="150px">ชือ - นามสกุล</td>
                                            <td width="50px">ตำแหน่ง</td>
                                        </tr>
                                     </table>
                               </HeaderTemplate>
                              <ItemTemplate>
                                    <table style="width: 100%" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="150px">
                                             <%# Eval("emp_name") %>
                                        </td>
                                        <td width="50px">
                                             <%# Eval("pos_name" )%>
                                       </td>
                                    </tr>
                                    </table>
                              </ItemTemplate>
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td>หมายเหตุ:</td>
                        <td>
                            <telerik:RadTextBox ID="txtRemark" runat="server" Height="80px" Width="500px" TextMode="MultiLine">
                            </telerik:RadTextBox>
                         </td>
                    </tr>
                    <tr>
                        <td colspan="3" align="center">
                            <asp:LinkButton ID="btnUpdate" runat="server" Text="บันทึก" Width="64px" CssClass="LinkButton"
                                OnClientClick="javascript:return confirm('ต้องการแก้ไขข้อมูลใช่หรือไม่')"
                                onclick="btnUpdate_Click" />
                            <asp:LinkButton ID="btnOk" runat="server" Text="บันทึก" Width="64px" CssClass="LinkButton"
                                OnClientClick="javascript:return confirm('ต้องการบันทึกข้อมูลใช่หรือไม่')"
                                onclick="btnOk_Click" />&nbsp;&nbsp;&nbsp;
                            <asp:LinkButton ID="btnCancle" runat="server" Text="ยกเลิก" CausesValidation="false" CssClass="LinkButton"
                                OnClientClick="javascript:return confirm('ต้องการยกเลิกข้อมูลใช่หรือไม่')"
                                onclick="btnCancle_Click" />
                        </td>
                    </tr>
                </table>
             </asp:Panel>
         </div>
    </div>
    </form>
</body>
</html>
